<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-if v-else-if v-else</title>
    <script src="../vue.js"></script>
  </head>
  <body>
    <div id="box">
      <ul>
        <li v-for="item in dataList">
            {{item.title}}
            <div v-if="item.state===0">待付款</div>
            <div v-else-if="item.state===1">待发货</div>
            <div v-else="item.state===2">运输中</div>
        </li>
    </ul>
    </div>
    <script>
      let obj = {
        data() {
          return {
            dataList:[
                {title:'手机',state:0},
                {title:'衣服',state:1},
                {title:'aaa',state:2},
                {title:'bbb',state:1},
                {title:'aaa',state:2},
                {title:'手机',state:0},
                {title:'ccc',state:2},
            ]
          };
        },
      };
      Vue.createApp(obj).mount("#box");
    </script>
  </body>
</html>
